﻿using System.Windows;
using NavFx;

namespace NavFx.NavFxDemo
{
	/// <summary>
	/// Page to demonstrate replacing all of the content in a host
	/// </summary>
	public partial class FullPage: HostPage
	{
		#region Private members

		/// <summary>
		/// Reference to the component handling transitions from page to page
		/// </summary>
		private SimpleTransitor navTransitor = null;

		#endregion

		#region Constructors

		/// <summary>
		/// Default constructor
		/// </summary>
		public FullPage()
			: base()
		{
			//capture a reference to the component that handles
			//transition from page to page
			this.navTransitor = (SimpleTransitor)this.Navigator.Transitor;

			InitializeComponent();
		}

		#endregion
		
		#region Event handlers

		/// <summary>
		/// Go back to the home page on click of button
		/// </summary>
		private void goBack_Click(object sender, RoutedEventArgs e)
		{
			((SimpleTransitor)this.Navigator.Transitor).Target = Application.Current;
			this.Navigator.GoToPage("Home");
		}

		#endregion
	}
}
